﻿@using giaoxuhaison.Models

@{
    //HttpApplicationState application = HttpContext.Current.ApplicationInstance.Application;
    Layout = null;
}

@{
    var lstGroupAll = (List<GroupAll>)ViewData["lstGroup"];
    var listParentGroup = lstGroupAll.Where(t => t.GroupLevel == 1).ToList();
    var lstCategoryAll = (List<vw_CategoriesAll>)ViewData["lstCategoryAll"];
}


<script type="text/javascript">

    var alignWithMainMenu = false;

    function initmenu() { var e = document.getElementById("menuV2"), i = e.offsetHeight, b = e.getElementsByTagName("ul"), g = /msie|MSIE 6/.test(navigator.userAgent); if (g) for (var h = e.getElementsByTagName("li"), a = 0, j = h.length; a < j; a++) { h[a].onmouseover = function () { this.className = "onhover" }; h[a].onmouseout = function () { this.className = "" } } for (var a = 0; a < b.length; a++) { var c = b[a].parentNode; c.getElementsByTagName("a")[0].className += " arrow"; b[a].style.left = c.offsetWidth + "px"; b[a].style.top = c.offsetTop + "px"; if (alignWithMainMenu) { var d = getParentOffsetRoot(c.parentNode, 0); if (b[a].offsetTop + b[a].offsetHeight + d > i) { var f; if (b[a].offsetHeight > i) f = -d; else f = i - b[a].offsetHeight - d; b[a].style.top = f + "px" } } c.onmouseover = function () { if (g) this.className = "onhover"; var a = this.getElementsByTagName("ul")[0]; if (a) { a.style.visibility = "visible"; a.style.display = "block" } }; c.onmouseout = function () { if (g) this.className = ""; this.getElementsByTagName("ul")[0].style.visibility = "hidden"; this.getElementsByTagName("ul")[0].style.display = "none" } } for (var a = b.length - 1; a > -1; a--) b[a].style.display = "none" } function getParentOffsetRoot(a, b) { if (a.id == "menuV2") return b; else { b += a.offsetTop; return getParentOffsetRoot(a.parentNode.parentNode, b) } } if (window.addEventListener) window.addEventListener("load", initmenu, false); else window.attachEvent && window.attachEvent("onload", initmenu)

</script>

<div id="Category">
    <div class="LeftTitle">
        @Html.Label("DANH MỤC", new { @class = "lblLeftTitle" })                
    </div>
    <div class="groupLeft">
        <!--test menu left, se load tu db-->
        @*
        @foreach (var item in lstGroup)
        {
            <div class="LeftItem">
                <img src="../../Images/bullet-blue.png" align="absmiddle"/>
                @Html.ActionLink(item.GroupName, "IndexCategory", new { controller = "Category", action = "IndexCategory",GrpId = item.GroupID })
            </div>
        }
        *@        
        <ul id="menuV2">   
            @foreach (var item in listParentGroup)
            {
                var listChildGroup = lstGroupAll.Where(t => t.ParentID == item.GroupID).ToList();
                <li>
                    @if(item.GroupID == 37)
                    {
                        @Html.ActionLink(item.GroupName, "InformGroup", new { controller = "Inform", action = "InformGroup", GroupID = item.GroupID })
                    }
                    else if (item.GroupID == 38)
                    {
                        @Html.ActionLink(item.GroupName, "HappyNewsGroup", new { controller = "Categories", action = "HappyNewsGroup", GroupID = item.GroupID })
                    }
                    else if (item.GroupID == 39)
                    {
                        @Html.ActionLink(item.GroupName, "SadNewsGroup", new { controller = "Categories", action = "SadNewsGroup", GroupID = item.GroupID })
                    }
                    else if (item.GroupID == 40 || item.GroupID == 41)
                    {
                        @Html.ActionLink(item.GroupName, "ImgVideoGroup", new { controller = "Categories", action = "ImgVideoGroup", GroupID = item.GroupID })
                    }
                    else if (item.GroupID == 42)
                    {
                        @Html.ActionLink(item.GroupName, "DownloadDocument", new { controller = "Categories", action = "DownloadDocument", GroupID = item.GroupID })
                    }
                    else if (item.GroupID == 15)
                    {
                        @Html.ActionLink(item.GroupName, "About", new { controller = "Home", action = "About" })                        
                    }
                    else
                    {
                        @Html.ActionLink(item.GroupName, "CategoryGroup", new { controller = "Categories", action = "CategoryGroup", GroupID = item.GroupID })                        
                        @*@item.GroupName*@
                    }   
                                     
                    @if (listChildGroup != null && listChildGroup.Count > 0)
                    {
                        <ul class="sub">
                            @foreach (var subitem in listChildGroup)
                            {
                                var CateItem = lstCategoryAll.Where(t => t.GroupID == subitem.GroupID).OrderBy(t => t.CreationDate).Take(1).ToList();

                                if (subitem.Direct == 1)
                                {
                                    if (CateItem.Count > 0)
                                    {
                                        <li>@Html.ActionLink(subitem.GroupName, "CategoryDetail", new { controller = "Categories", action = "CategoryDetail", CategoryID = CateItem[0].CategoryID, GroupID = subitem.GroupID })</li>
                                    }
                                    else
                                    {
                                        <li>@Html.ActionLink(subitem.GroupName, "CategoryGroup", new { controller = "Categories", action = "CategoryGroup", GroupID = item.GroupID })</li>
                                    }
                                }
                                else
                                {
                                    <li>@Html.ActionLink(subitem.GroupName, "CategoryGroup", new { controller = "Categories", action = "CategoryGroup", GroupID = item.GroupID })</li>
                                }
                            }
                        </ul>
                    }
                </li>
            }            
            @*<li>
                <a href="#" class="arrow" >Lược sử Giáo Xứ</a>
                    <ul class="sub">
                        <li><a href="#">Ban Hành Giáo Xứ</a></li>                            
                        <li><a href="#">Giáo Họ Gioan</a></li>
                    </ul>                    
            </li>            
            <li>
                <a href="#">Hội Đồng Mục Vụ</a>                                     
            </li>            
            <li>
                <a href="#">Hội Đồng Mục Vụ</a>
                    <ul class="sub">
                        <li><a href="#">Ban Hành Giáo Xứ</a></li>                            
                        <li><a href="#">Giáo Họ Gioan</a></li>
                    </ul>                    
            </li>            
            <li>
                <a href="#" class="arrow" >Lược sử Giáo Xứ</a>
                    <ul class="sub">
                        <li><a href="#">Ban Hành Giáo Xứ</a></li>                            
                        <li><a href="#">Giáo Họ Gioan</a></li>
                    </ul>                    
            </li>            
            <li>
                <a href="#">Hội Đồng Mục Vụ</a>                                     
            </li>            
            <li>
                <a href="#">Hội Đồng Mục Vụ</a>
                    <ul class="sub">
                        <li><a href="#">Ban Hành Giáo Xứ</a></li>                            
                        <li><a href="#">Giáo Họ Gioan</a></li>
                    </ul>                    
            </li> *@
        </ul>
        
    </div>
</div>
@*hinh nam thanh*@
<div class="groupLeft" id="HappyLink">
    <div align="center" style="margin-bottom:7px; margin-top:7px;">
        <a href="http://giaoxuhaison.net/Faiths/FaithsDetail?FaithID=11&GroupID=11"><img src="~/Images/Banner/Link/nam2014.jpg" style="width: 192px; height: 217px;" /></a>
    </div>
</div>

<div id="Images">
    <div class="LeftHappyTitle">
        @*<b align="center">@Html.ActionLink("CHÚC MỪNG", "HappyNewsGroup", new { controller = "Categories", action = "SpecialNewsGroup", GroupID = 38 })</b>*@
        <a href='@Url.Action("HappyNewsGroup", "Categories", new { GroupID = 38 })' >
        <img src="~/Images/News/congratulation.png" />        
        </a>
    </div>
    <div class="groupHappyLeft">
        @Html.Action("NewLeftHappy", "Categories", new { GroupID = 38 })
    </div>
</div>
<!--cao pho-->
<div id="Images">
    <div class="LeftSadTitle">
        @*<b align="center">@Html.ActionLink("CHÚC MỪNG", "HappyNewsGroup", new { controller = "Categories", action = "SpecialNewsGroup", GroupID = 38 })</b>*@
        <a href='@Url.Action("SadNewsGroup", "Categories", new { GroupID = 39 })' >
        <img src="~/Images/News/sad_news.png" />        
        </a>
    </div>
    <div class="groupSadLeft">
        @Html.Action("NewLeftSad", "Categories", new { GroupID = 39 })        
    </div>
</div>

<div class="LeftTitle">
    @Html.Label("LIÊN KẾT", new { @class = "lblLeftTitle" })
</div>
<div id="link">
    <div class="groupLeft">
        <div align="center" class="DownloadApps">
            <a href='@Url.Action("CategoryDetail", "Categories", new { CategoryID = 1, GroupID = 43 })' >
            <img src="~/Images/Banner/Link/DTCha.JPG" style="width: 190px; height: 60px;" /></a>
        </div> 
        <div align="center" class="DownloadApps">
            <a href="http://www.vatican.va/various/basiliche/san_giovanni/vr_tour/index-en.html" target="_blank">
            <img src="~/Images/Banner/Link/vatican.jpg" style="width: 190px; height: 100px;" /></a>
        </div> 
        <div align="center" class="DownloadApps">
            <a href="http://www.giaophanbaria.org/" target="_blank">
            <img src="~/Images/Banner/Link/gpBaRia.JPG" style="width: 190px; height: 60px;" /></a>
        </div>      
        <div align="center" class="DownloadApps">
            <a href="http://thanhcavietnam.net/" target="_blank">
            <img src="~/Images/Banner/Link/ThanhCa.JPG" style="width: 190px; height: 60px;" /></a>
        </div> 
        <div align="center" class="DownloadApps">
            <a href="http://www.hdgmvietnam.org/" target="_blank">
            <img src="~/Images/Banner/Link/HDGMVietNam.jpg" style="width: 190px; height: 60px;" /></a>
        </div> 
        <div align="center" class="DownloadApps">
            <a href="http://tgpsaigon.net/" target="_blank">
            <img src="~/Images/Banner/Link/gptphcm.jpg" style="width: 190px; height: 60px;" /></a>
        </div>         
        <div align="center" class="DownloadApps">
            <a href="http://paolinevn.org/jclubthieunhi/" target="_blank">
            <img src="~/Images/Banner/Link/thieu_nhi.jpg" style="width: 190px; height: 190px;" /></a>
        </div> 
    </div>
</div>
@*--video*@
<div id="Images">
    <div class="VideoTitle">
        @*<b align="center">@Html.ActionLink("CHÚC MỪNG", "HappyNewsGroup", new { controller = "Categories", action = "SpecialNewsGroup", GroupID = 38 })</b>*@
        <a href='@Url.Action("ImgVideoGroup", "Categories", new { GroupID = 41 })' >
        <img src="~/Images/Banner/video.png" />        
        </a>
    </div>
    <div class="groupSadLeft">
        @Html.Action("NewVideo", "Categories", new { GroupID = 41 })
        @*<iframe width="192" height="151" src="http://www.youtube.com/embed/t7tbi0d-9Lk?rel=0" frameborder="0" allowfullscreen></iframe>*@
    </div>
</div>

<div class="LeftTitle">
    @Html.Label("LIÊN HỆ GỬI BÀI", new { @class = "lblLeftTitle" })
</div>
<div class="groupLeft" id="HappyLink">
    <div align="center" style="margin-bottom:7px; margin-top:7px;"><i style="color:Red;">Thư từ, bài viết xin vui lòng gửi về địa chỉ: <a href="mailto:gxhaison@gmail.com">gxhaison@gmail.com</a></i></div>
</div>

<div class="LeftTitle">
    @Html.Label("THỐNG KÊ TRUY CẬP", new { @class = "lblLeftTitle" })
</div>
<div class="groupLeft">
    <div class="Access" align="center">
        @{
            var intAccess = (int)HttpContext.Current.Application["Access"];
            var strAccess = intAccess.ToString();
            for (int i = 0; i < strAccess.Length; i++)
            {
                switch (strAccess[i])
                {
                    case '0': <img src="~/Images/Banner/numbers/0.gif" />; break;
                    case '1': <img src="~/Images/Banner/numbers/1.gif" />; break;
                    case '2': <img src="~/Images/Banner/numbers/2.gif" />; break;
                    case '3': <img src="~/Images/Banner/numbers/3.gif" />; break;
                    case '4': <img src="~/Images/Banner/numbers/4.gif" />; break;
                    case '5': <img src="~/Images/Banner/numbers/5.gif" />; break;
                    case '6': <img src="~/Images/Banner/numbers/6.gif" />; break;
                    case '7': <img src="~/Images/Banner/numbers/7.gif" />; break;
                    case '8': <img src="~/Images/Banner/numbers/8.gif" />; break;
                    case '9': <img src="~/Images/Banner/numbers/9.gif" />; break;
                    default: break;
                }
            }    
        }        
    </div>    
    <div class="Online" align="center">
        <img src="~/Images/online.png" align="absmiddle"/>
        <i>đang online: </i><strong style="color:Red;">@HttpContext.Current.Application["OnlineUsers"].ToString()</strong><br />                
    </div>
    @*
    <div class="Access"> &nbsp;&nbsp; Lượng truy cập: <b>@HttpContext.Current.Application["Access"].ToString()</b></div>    
    <div class="Online">
        &nbsp;&nbsp; <b>@HttpContext.Current.Application["OnlineUsers"].ToString()</b>Khách online
    </div>
    *@
</div>
